<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>

<form id="pagerForm" action="demo/database/dwzOrgLookup2.html">
	<input type="hidden" name="pageNum" value="1" />
	<input type="hidden" name="numPerPage" value="${model.numPerPage}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
	<input type="hidden" name="orderDirection" value="${param.orderDirection}" />
</form>

<div class="pageHeader">
	<form rel="pagerForm" method="post" action="${pageContext.request.contextPath}/merchant/merchantProduct/getMerchantAsset" onsubmit="return dwzSearch(this, 'dialog');">
	<div class="searchBar">
		<ul class="searchContent">
			<li>
				<label>分组:</label>
				<select class="combox" name="commonTypeId">
					<option value="">请选择</option>
					<c:forEach items="${requestScope.typeAll}" var="item">
					<option value="${item.commonTypeId}"${item.commonTypeId == requestScope.dwzPageBean.countResultMap.commonTypeId?"selected":""}>${item.typeName}</option>
					</c:forEach>
				</select>
			</li>	  
		</ul>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" onclick="parentFunction();" multLookup="id" warn="请选择图片">选择</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">

	<table class="list" targetType="navTab" asc="asc" desc="desc" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="22"><input type="checkbox" group="id" class="checkboxCtrl"></th>
				<th>资源分组</th>
				<th>图片url</th>
				<th>图片名称</th>
			</tr>
		</thead>
		<tbody>
			<c:if test="${requestScope.dwzPageBean != null &&  requestScope.dwzPageBean.recordList != null }">
				<c:forEach var="record" items="${requestScope.dwzPageBean.recordList}" varStatus="status">
					<tr>
						<td><input name="id" value="{picUrl:'${pageContext.request.contextPath}${record.assetUrl}'}" type="checkbox">
						</td>
						<td>${record.tname}</td>
						<td><img width="100px" height="80px" alt="${record.picName}" src="${pageContext.request.contextPath}${record.assetUrl}"></td>
						<td>${record.picName}</td>
					</tr>
				</c:forEach>
			</c:if>
		</tbody>
	</table>
	<!-- 分页条 -->
	<%@include file="/WEB-INF/page/inc/pageBar.jsp"%>
</div>
<!--子页面中的JS代码-->
<script type="text/javascript">
function parentFunction(){
	var _ids = $("[name='id']");
	var check_val = [];
    for(k in _ids){
        if(_ids[k].checked)
            check_val.push(_ids[k].value);
    }
	window.parent.setpicUrls(check_val);
}
</script>